package ui.map 
{
	import com.gaiaframework.api.Gaia;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import pages.Pages;
	
	/**
	 * ...
	 * @author usual
	 */
	public class MapMarker extends MovieClip 
	{
		private var _markerClip:SmallBulleMarker;
		public function MapMarker() 
		{
			addEventListener(Event.ADDED_TO_STAGE, build);
			trace("[MapMarker.MapMarker] ");
		}
		
		private function build(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, build);
			setMarker();
		}
		
		private function setMarker():void 
		{
			_markerClip = new SmallBulleMarker();
			mouseChildren = false;
			buttonMode = true;
			cacheAsBitmap = true;
			addChild(_markerClip);
			addEventListener(MouseEvent.CLICK, _click);
		}
		
		private function _click(e:MouseEvent):void 
		{
			Gaia.api.goto(Pages.TIMELINE + '/' + this.name);
		}
		
	}

}